import request from '@/utils/request'

// 查角色列表
export const getRoleListData = (params) => {
  return request({
    url: '/sys/role/',
    method: 'GET',
    params
  })
}
// 查角色信息
export const getRoleInfo = (id) => {
  return request({
    url: '/sys/role/' + id,
    method: 'GET'
  })
}
// 增加角色信息
export const addRoleInfo = (data) => {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
// 修改角色信息
export const editRoleInfo = (data) => {
  return request({
    url: '/sys/role/' + data.id,
    method: 'PUT',
    data
  })
}
// 删除角色信息
export const delRoleInfo = (id) => {
  return request({
    url: '/sys/role/' + id,
    method: 'DELETE'
  })
}
// 获取公司信息
export const getCompanyInfo = (id) => {
  return request({
    url: '/company/' + id,
    method: 'GET'
  })
}
// 给角色分配权限
export const assignPrem = (data) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
